<template>
	<view class="app">
		<view class="panel">
			<view class="flex-col items-center indexpage">
				<navigator class="indexnav" url="listorder">订单管理</navigator>
				<navigator class="indexnav" url="techlist">技师管理</navigator>
				<navigator class="indexnav" url="coupons">赠送优惠券</navigator>
				<navigator class="indexnav" url="notify">支付补单<text>（客户支付成功,但订单状态为取消）</text></navigator>
				<view class="indexnav loginout" @click="loginOut()">退出登录</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			const token=uni.getStorageSync('serv_token');
			if(!token){
				uni.navigateTo({
					url:'/pages/login'
				});
				return;
			}
		},
		methods: {
			loginOut(){
				uni.showModal({
					title:'提示',
					content:'是否确认退出登录?',
					confirmText:'退出登录',
					complete(e) {
						if(e.confirm){
							uni.removeStorageSync('serv_token');
							uni.navigateTo({
								url:'/pages/login'
							});
						}
						
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	.indexpage{
		.indexnav{
			display: block; width: 100%; padding: 12px 0; border-bottom:solid 1px #f0f0f0;
		}
		.indexnav>text{
			font-size: 12px; color: #999;
		}
		.loginout{
			margin-top: 32px; text-align: center;
		}
	}
</style>
